<?php if($create_allow == true) : ?>
<div id="asknote">
	<h3>Ask to use Practice Test</h3>
	<ol>
		<li>Prepare exercises before creating practice test</li>
		<li>Practice test have two format: True/False and more answer (A.B.C.D)</li>
		<li>If your question is Yes-No (True/False) you just create one answer and please select the correct answer</li>
		<li>If your question is more answer (A.B.C.D) you just create four answer and please select the correct answer</li>
		<li>Please fill field required</li>
		<li>Please not spam system</li>
	</ol>
	<p>Thanks for reading</p>
</div>
<div id="izPracticetestInfo">
	<div class="save_info"></div>
	<label for="izPracticetestInfo">Practice Test Information<span class="save_information">+ Save Information</span></label>
	<div id="izPracticetestLevel" class="izInformation">
		<label for="izlevel">Level<em>*</em></label>
		<select name="izlevel" id="izlevel">
			<option <?php echo ($practice_test->level=="Khó") ? "selected" : ""; ?>>Khó</option>
			<option <?php echo ($practice_test->level=="Trung bình") ? "selected" : ""; ?>>Trung bình</option>
			<option <?php echo ($practice_test->level=="Dễ") ? "selected" : ""; ?>>Dễ</option>
		</select>
	</div>
	<div id="izPracticetestTime" class="izInformation">
		<label for="iztime">Time<em>*</em></label>
		<input type="text" name="iztime" id="iztime" value="<?php echo !empty($practice_test->time) ? $practice_test->time : ""; ?>"/>
		<span>( Math time: 1h => 60 )</span>
	</div>
	<div id="izPracticetestRequirements" class="izInformation">
		<label for="izrequirements">Requirements<em>*</em></label>
		<textarea name="izrequirements" id="izrequirements"><?php echo !empty($practice_test->requirements) ? $practice_test->requirements : ""; ?></textarea>
	</div>
	<div id="izPracticetestNote" class="izInformation">
		<label for="iznote">Notes<em>*</em></label>
		<textarea name="iznote" id="iznote"><?php echo !empty($practice_test->note) ? $practice_test->note : ""; ?></textarea>
	</div>
	<input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>">
	<input type="hidden" name="author_id" id="author_id" value="<?php echo $author_id; ?>">
	<input type="hidden" name="is_save" id="is_save" value="<?php echo !empty($practice_test->id) ? "true" : ""; ?>">
	<input type="hidden" name="practicetest_id" id="practicetest_id" value="<?php echo !empty($practice_test->id) ? $practice_test->id : ""; ?>">
</div>
<div id="izMainQuestion">
<?php foreach($fieldquestion as $question) : ?>
	<?php $listAnswer = $this->PracticeTestAnswerModel->getPracticeTestAnswer($question->id); ?>
	<div class='izboxQuestion'>
		<div class='save_question_db'></div>
		<label for='izQuestionTitle'>Question<span class='remove_question'>+ Remove Question</span>
			<!-- <span class='save_question'>+ Save Question</span> -->
		</label>
		<!-- <input type='text' name='izQuestion' value="<?php //echo $question->question; ?>" id='izQuestion' class='izQuestion'/> -->
		<div id='izQuestion' class='izQuestion'><?php echo limitWord($question->question,120); ?></div>
		<label for='izAnswerTitle'>Answer
			<div class="save_answer_db"></div>
			<?php if(count($listAnswer) ==4 || $listAnswer[0]->answer == "True/False"): ?>
				<span class='save_answer' <?php echo ($listAnswer[0]->answer == "True/False") ? "data-question='true'" : ""; ?>>+ Save Answer</span>
			<?php else : ?>
				<span class='add_answer'>+ Add Answer</span>
			<?php endif; ?>
		</label>
		<input type='hidden' name='question_id' class='question_id' value="<?php echo $question->id; ?>" />
		<div class='izboxAnswer'>
			<?php foreach($listAnswer as $key=>$answer) : ?>
				<?php if($answer->answer =="True/False") : ?>
				<div class='answer'>
					<label for='true'><input type='radio' <?php echo ($answer->is_answer ==1) ? "checked" : ""; ?> name='izAddAnswer_<?php echo $answer->id; ?>' class='izAddAnswer' value='True'/>True</label>
					<label for='false'><input type='radio' name='izAddAnswer_<?php echo $answer->id; ?>' <?php echo ($answer->is_answer ==0) ? "checked" : ""; ?> class='izAddAnswer' value='False'/>False</label>
					<input type='hidden' name='answer_id' class='answer_id' value="<?php echo $answer->id; ?>" />
				</div>
				<?php else : ?>
				<div class='addAnswer'>
					<label>
						<?php echo changeLabel((int)$key+1); ?>
						<input type='radio' class='add izAddAnswer' <?php echo ($answer->is_answer ==1) ? "checked" : ""; ?> value="<?php echo $answer->answer; ?>" name='izAddAnswer_<?php echo $question->id; ?>'/>
						<!-- <span><?php //echo $answer->answer; ?></span> -->
						<input type='hidden' name='answer_id' class='answer_id' value="<?php echo $answer->id; ?>" />
					</label>
					<span class='updateInput'><?php echo limitWord($answer->answer,120); ?></span>
					<!-- <span class='updateInput'> + Update</span> -->
				</div>
				<?php endif; ?>
			<?php endforeach; ?>
		</div>
	</div>
<?php endforeach; ?>
</div>
<?php else : ?>
<p>You don't permissions</p>
<?php endif; ?>
<p>
	<?php if($create_allow == true) : ?>
	<input type="button" id="add_question" value="Add Question" class="button button-primary button-large">
	<input type="button" id="show_information" value="Show / Hide Practice Test Information" class="button button-primary button-large">
	<input type="button" id="ask_use" value="Ask to use" class="button button-primary button-large">
	<?php endif; ?>
	<span class="izdeveloper">Developer by Izwebz Team, Created: Mr. Nav</span>
</p>